package Prova::Archiver;

use strict;
use warnings;
use Archive::Zip;
use File::Spec;

=head1 NAME

Prova::Archiver

=head1 DESCRIPTION

none

=head1 METHODS

=cut

=head2 archive

=cut

sub archive {
    my ( $self, $c, $dir ) = @_;

    my $zip = Archive::Zip->new;
    $zip->addTree( $dir );

    my $name = File::Spec->catfile( $dir, 'archive.zip' );
    $zip->writeToFileNamed( $name );

    return $name;
}

=head1 AUTHOR

Shanon Inc, E<lt>http://www.shanon.co.jp/E<gt>

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;
